package app.domain;

import lombok.*;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.stereotype.Component;

import javax.persistence.*;
import java.io.Serializable;


//标识实体
@Entity
//表名
@Table(name = "ur")
//get set toString
@Getter
@Setter
@ToString
@EqualsAndHashCode
//有参构造
@AllArgsConstructor
//无参构造
@NoArgsConstructor
//标识当前的类会被spring boot扫描并在需要的时候创建对象
@Component
public class Ur  implements Serializable {
    @Id
    //设置主键生成策略
    @GenericGenerator(name = "pk", strategy = "increment")
    //使用主键生成策略
    @GeneratedValue(generator = "pk")
    @Column(name = "userid")
    private Integer userId;
    @Column(name = "roleid")
    public Integer roleId;
}
